package com.luke.star.bean.enums;

import java.util.LinkedHashMap;
import java.util.Map;

public enum ReportDateTypeEnum{
	thisweek("01", "本周"), 
	thismonth("02", "本月"),
	dayweek("03", "日/周"), 
	daymonth("04", "日/月"), 
	weekmonth("05", "周/月"), 
	monthyear("06", "月/年"), 
	;
	
	public String code;
	public String desc;
	private ReportDateTypeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public static Map<String, String> getDataMap() {
		Map<String, String> keyValueMap = new LinkedHashMap<>();
		for (ReportDateTypeEnum single : ReportDateTypeEnum.values()) {
			keyValueMap.put(single.code, single.desc);
		}
		return keyValueMap;
	}
	public static String getDesc(String code) {
		for (ReportDateTypeEnum single : ReportDateTypeEnum.values()) {
			if(single.code.equals(code)) {
				return single.desc;
			}
		}
		return code;
	}
}
